import request from "@/utils/request";

export function getBaseInfo(query) {
  return request({
    url: "/device/data/list",
    method: "get",
    params: query,
  });
}

// export function getDeviceDetail(id) {
//   return request({
//     url: "/device/data/" + id,
//     method: "get",
//   });
// }

export function getDeviceDetail(query) {
  return request({
    url: "/dc3/device/data/by/name",
    method: "get",
    params: query,
  });
}

/**
 * 电极帽经济性
 * @param {Object} query - 查询参数对象，包含请求URL中的参数信息
 * @param {String} query.deviceName - 参数，设备名
 * @returns {Promise} - 返回一个Promise对象，包含服务器响应的数据
 */
export function getCapEconomy(query) {
  return request({
    url: "/device/cap/event/list",
    method: "get",
    params: query,
  });
}

// 修改用户
export function updateCapPrice(data) {
  return request({
    url: "/device/data",
    method: "put",
    data: data,
  });
}
